It's not clear what it would mean, and it leads to division by zero.
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
{
s_time_t missed_ticks;
+ if ( unlikely(pt->one_shot) )
+ return;
+
missed_ticks = NOW() - pt->scheduled;
if ( missed_ticks <= 0 )
return;
pt_lock(pt);
pt->pending_intr_nr++;
- pt->scheduled += pt->period;
- missed_ticks(pt);
-
- if ( !pt->one_shot )
+ if ( unlikely(pt->one_shot) )
+ {
+ pt->enabled = 0;
+ list_del(&pt->list);
+ }
+ else
+ {
+ pt->scheduled += pt->period;
+ missed_ticks(pt);
set_timer(&pt->timer, pt->scheduled);
+ }
vcpu_kick(pt->vcpu);